<?php
	$conn = mysql_connect("localhost","root","1234") or die(mysql_error());
	$db = mysql_select_db("book_db") or die("Cannot select db");
	mysql_query("SET character_set_results=tis620");
    mysql_query("SET character_set_client=tis620");
    mysql_query("SET character_set_connection=tis620");
	mysql_query("SET NAMES windows");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>แก้ไขข้อมูล</title>
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
<style type="text/css">
body {
	background-color: #82AFFB;
}
</style>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
</head>

 <script>
$(document).ready(function() {
$("#datepicker").datepicker({ dateFormat: "yy/mm/dd" }).val()
});
</script>
</head>

<body>
<table width="857" height="637" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="133" colspan="8"><img src="../image/mix.jpg" width="860" height="175" /></td>
  </tr>
  <tr>
    <td width="144"><a href="file:///G|/pppppppppppppppppppppppppp/bok/add_officer.php"><img src="../image/menuadmin1.jpg" width="140" height="40" /></a></td>
    <td width="144"><a href="file:///G|/pppppppppppppppppppppppppp/bok/add_members.php"><img src="../image/menuadmin2.jpg" width="140" height="40" /></a></td>
    <td width="144"><a href="file:///G|/pppppppppppppppppppppppppp/bok/Addbook.html"><img src="../image/menuadmin3.jpg" width="140" height="40" /></a></td>
    <td width="144"><a href="file:///G|/pppppppppppppppppppppppppp/bok/add_pub.php"><img src="../image/menuadmin4.jpg" width="140" height="40" /></a></td>
    <td width="138"><img src="../image/menuadmin5.jpg" width="138" height="46" /></td>
    <td width="144"><img src="../image/menuadmin8.jpg" width="144" height="46" /></td>
  </tr>
  <tr>
    <td colspan="8"><form id="form1" name="form1" method="post" action="file:///G|/pppppppppppppppppppppppppp/bok/save_editofficer.php?OfficerID=<?php echo $_GET["OfficerID"];?>">
      <table width="604" border="0" align="center">
        <tr>
          <td colspan="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;แก้ไขข้อมูลพนักงาน</td>
          </tr>
        <tr>
          <td>รหัสพนักงาน</td>
          <td><input name="OfficerID" type="text" id="OfficerID" size="30" maxlength="5" value="<?php echo $objResult["OfficerID"];?>" />
            *</td>
          </tr>
        <tr>
          <td width="139">ชื่อ-นามสกุล</td>
          <td width="400"><label for="OfficerName"></label>
            <input name="OfficerName" type="text" id="OfficerName" maxlength="50" value="<?php echo $objResult["OfficerName"];?>" /></td>
          </tr>
        <tr>
          <td height="28">ปี/เดือน/วัน เกิด</td>
          <td><input type="text" name="OfficerBirth" id="datepicker" value="<?php echo $objResult["OfficerBirth"];?>" /></td>
          </tr>
        <tr>
          <td height="28">เลขบัตรประชาชน</td>
          <td><label for="OfficerNum"></label>
            <input type="text" name="OfficerNum" id="OfficerNum" value="<?php echo $objResult["OfficerNum"];?>" /></td>
          </tr>
        <tr>
          <td height="28">ที่อยู่</td>
          <td><textarea name="OfficerAddress" cols="30" rows="3" id="OfficerAddress"><?php echo $objResult["OfficerAddress"];?></textarea></td>
          </tr>
        <tr>
          <td height="28">เบอร์โทรศัพท์</td>
          <td><label for="OfficerTel"></label>
            <input type="text" name="OfficerTel" id="OfficerTel" value="<?php echo $objResult["OfficerTel"];?>" /></td>
          </tr>
        <tr>
          <td height="28">อีเมล์</td>
          <td><input type="text" name="OfficerEmail" id="OfficerEmail" value="<?php echo $objResult["OfficerEmail"];?>"/>
            *</td>
          </tr>
        <tr>
          <td height="28">&nbsp;</td>
          <td><input type="submit" name="Submit" id="Submit" value="ตกลง" />
            &nbsp;&nbsp;&nbsp;&nbsp;
            <input type="reset" name="Reset" id="Reset" value="ยกเลิก" />
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
          </tr>
        </table>
    </form>
    </form></td>
    <?php
	$objConnect = mysql_connect("localhost","root","1234") or die("Error Connect to Database");
	$objDB = mysql_select_db("book_db");
	$strSQL=mysql_query("SET NAMES TIS620");
	$strSQL = "SELECT * FROM officer WHERE OfficerID = '".$_GET["OfficerID"]."' ";
	$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
	$objResult = mysql_fetch_array($objQuery);
?>
  </tr>
</table>
</body>
</html>